package com.ruoyi.basicsys.service.impl;

import java.util.List;

import com.ruoyi.basicsys.domain.BasicBuilding;
import com.ruoyi.pojo.constant.RConst;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.basicsys.mapper.BasicCommunityMapper;
import com.ruoyi.basicsys.domain.BasicCommunity;
import com.ruoyi.basicsys.service.IBasicCommunityService;

/**
 * 小区管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-07-25
 */
@Service
public class BasicCommunityServiceImpl implements IBasicCommunityService 
{
    @Autowired
    private BasicCommunityMapper basicCommunityMapper;

    /**
     * 查询小区管理
     * 
     * @param id 小区管理主键
     * @return 小区管理
     */
    @Override
    public BasicCommunity selectBasicCommunityById(Long id)
    {
        return basicCommunityMapper.selectBasicCommunityById(id);
    }

    /**
     * 查询小区管理列表
     * 
     * @param basicCommunity 小区管理
     * @return 小区管理
     */
    @Override
    public List<BasicCommunity> selectBasicCommunityList(BasicCommunity basicCommunity)
    {
        return basicCommunityMapper.selectBasicCommunityList(basicCommunity);
    }

    /**
     * 新增小区管理
     * 
     * @param basicCommunity 小区管理
     * @return 结果
     */
    @Override
    public int insertBasicCommunity(BasicCommunity basicCommunity)
    {
        //默认设置管理员电话号码
        basicCommunity.setAdministratorsPhone("18696528695");
        //默认设置管理员名字
        basicCommunity.setAdministratorsName("橘子");
        //状态默认设置为0
        return basicCommunityMapper.insertBasicCommunity(basicCommunity);
    }

    /**
     * 修改小区管理
     * 
     * @param basicCommunity 小区管理
     * @return 结果
     */
    @Override
    public int updateBasicCommunity(BasicCommunity basicCommunity)
    {
        return basicCommunityMapper.updateBasicCommunity(basicCommunity);
    }

    /**
     * 批量删除小区管理
     * 
     * @param ids 需要删除的小区管理主键
     * @return 结果
     */
    @Override
    public int deleteBasicCommunityByIds(Long[] ids)
    {
        return basicCommunityMapper.deleteBasicCommunityByIds(ids);
    }

    /**
     * 删除小区管理信息
     * 
     * @param id 小区管理主键
     * @return 结果
     */
    @Override
    public int deleteBasicCommunityById(Long id)
    {
        return basicCommunityMapper.deleteBasicCommunityById(id);
    }

    /**
     * 查询所有的小区名字
     * @return
     */
    @Override
    public List<BasicCommunity> selectAllCommunity() {
        return basicCommunityMapper.selectAllCommunity();
    }
}
